NAND flash memory based Solid-State Drives (SSDs) have been used widely in enterprise servers and data centers to accelerate all kinds of data storage systems. Flash memory in SSDs has unique characteristics, so directly replacing a conventional magnetic disk with an SSD does not make use of the device at its full potential. One significant reason is that SSDs only write to free flash memory blocks, and recover invalid flash memory blocks for reuse using a Garbage Collection process. Because conventional operating systems and applications do not distinguish between hot and cold data, the mix of data with different lifespan makes it harder for Garbage Collection to manage and reclaim flash memory. This affects both the performance and the lifetime of the SSD.
Currently, many data storage systems—including object storage systems (e.g., Ceph), block storage systems (e.g., bcache and other caching systems), and file storage systems (e.g., IBM JFS/JFS2, Linux xfs, and Linux ext4)—use journaling for data durability and performance purposes. Such systems store two copies of data: one in the Journal section and one in the data section. When such systems are deployed in a pure SSD environment, they usually store journals and actual data on the same SSD, for performance and cost reasons. When data is received to be written, the data storage system first stores one copy of the data record in a journal that is flushed to the disk, and the second copy of the data is stored in the file system page cache in memory. The data storage system then returns success to the user application. Later, sometime in the background, the data storage systems flush those data records in the file system page cache into disk, and remove the same data records in the journal on disk. This process repeats with each data write, and occurs even if a journal is only used for metadata.
This double-write approach, when used with SSDs, has a problem: flash memory internal fragmentation inside every SSD block. This internal fragmentation problem causes more Garbage Collection, resulting in storage system performance degradation, longer read/write latency, and a shorter SSD lifetime.
A need remains for a way to utilize double-write approaches with SSDs that avoids (or at least minimizes) the fragmentation of the flash memory in the SSD.